<template>
  <a-tabs default-active-key="1">
    <a-tab-pane key="1" tab="授权店铺">
      <shop-auth-list ref="shopRef"></shop-auth-list>
    </a-tab-pane>
    <!-- <a-tab-pane key="2" tab="授权仓库" force-render>    
      <store-warehouse-list ref="warehouseRef"></store-warehouse-list>
    </a-tab-pane> -->
    <a-tab-pane key="3" tab="授权成本中心" force-render>    
      <cost-center-list ref="costCenterRef"></cost-center-list>
    </a-tab-pane>
  </a-tabs>
</template>
<script>
import shopAuthList from './component/shopAuthList'
import storeWarehouseList from './component/storeWarehouseList'
import costCenterList from './component/costCenterList'

export default {
  components: { shopAuthList,storeWarehouseList,costCenterList },
  data() {
    return {
      id:'',
    }
  },
  methods:{
    //初始化加载数据
    init(id){
      this.id = id
      this.$nextTick(()=>{
        this.$refs.shopRef.getInitData(id)
        // this.$refs.warehouseRef.getInitData(id)
        this.$refs.costCenterRef.getInitData(id)
      })  
    },
    //获取选中的ids
    // getSelectedIds(){
    //   const storeIds = this.$refs.shopRef.targetKeys || []
    //   const warehouseIds = this.$refs.warehouseRef.targetKeys ||[]
    //   const costCenterIds = this.$refs.costCenterRef.targetKeys ||[]
    //   return { storeIds, warehouseIds,costCenterIds }
    // }
    getSelectedIds(){
      const storeIds = this.$refs.shopRef.targetKeys || []
      const warehouseIds = null
      const costCenterIds = this.$refs.costCenterRef.targetKeys ||[]
      return { storeIds, warehouseIds,costCenterIds }
    }
  },
}
</script>
<style lang="less" scoped>
</style>